<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>Bom明细查看管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/yd/basic/bomInfo";
		var basic_WUrl="yd/basic/bomInfo";
		var basic_Title="添加";
		var show_Width=320;
		var show_Hight=150;
		function createSearch(){
			init(1,8,'100,100,100,100,100,100,100,100','20%');

			//第一行的数据
			addCommon(0,0,"lable","客户简码：");
			addCommon(0,1,"txtlike","customerId");
			addCommon(0,2,"lable","封装类型：");
			addCommon(0,3,"txtlike","packageType");
			addCommon(0,4,"lable","规格型号：");
			addCommon(0,5,"txtlike","spec");
			addCommon(0,6,"lable","成品编码：");
			addCommon(0,7,"txtlike","code");
			multipleSearch("#table1",true,"",basic_Url+"/list.do");
		}
		
		function searchAP(){
			multipleSearch("#table1",true,"",basic_Url+"/list.do");
		}
		
		//导出BOM
		function exportAP(){
		   	var filtersStr = generateCondition();
		   	window.open(basic_Url+"/exportExcel.do?filters="+filtersStr+"&_search=true","_blank");
		}
		
	/* 	
		function gettreeData() 
		 {    
			var manager = null;
			manager = $("#tree1").ligerGetTreeManager(); 
			manager.clear();
	        manager.loadData(null, basic_Url+'/tree.do');
	        manager.collapseAll();
		 } */
		
		jQuery(document).ready(function() {
			//创建JQGRID表格
			var grid = $("#table1").ligerGrid({
		        columns: [
						  { display: '成品编码', name: 'code', width: 150 },
						  { display: '成品名称', name: 'name', width: 120 },
		                  { display: '客户简码', name: 'customerId', width: 100 },
		                  { display: '封装类型', name: 'packageType', width: 150 },
		                  { display: '规格型号', name: 'spec', width: 150 },
		                  { display: '创建时间', name: 'dctime', width: 150,
		                	  render: function (item){
		                		  var cdate=new Date(item.dctime);
		                		  return formatDate(cdate,"yyyy-MM-dd");
		                	  }
		                  },
		                      ],  usePager: true,pageSize:15,enabledSort:false,
		                      width: "100%", height:"92%",pageSizeOptions :[15,25,35], checkbox: true,      
		                      onDblClickRow : function (data, rowindex, rowobj){
		                    	  edititem(data);
		                       },
//		                      toolbar: { items: [
// 		                                          { text: '修改', click: getSelected, icon: 'modify' },
// 		                                          { line: true },
// 		                                          { text: '删除', click: del, img: '../../../js/ligerUI/skins/icons/delete.gif' }
// 		                                          ]
// 		                                          }
		                  });
			$("#pageloading").hide();
			
			
//			$("#layout1").ligerLayout({ leftWidth: 200,height: '100%',heightDiff:-24,space:4});
			
			 
			/* 
			$("#tree1").ligerTree({  
				 url: basic_Url+'/tree.do',
				 nodeWidth: 200,
				 checkbox: false,
		         slide: false,
		         onClick:function(node){
		        	 multipleSearch("#table1",true,"",basic_Url+"/list.do?assemblyItem="+node.data.code);
		         }
		     }); */
			
			//修改物料
			 function edititem(data){
					var url = "yd/basic/bomInfo/operate/edit/"+data.code+".do";
					ShowIframeDialog("operate","BOM明细",url,320,300);
			}
			 
		});
	</script>
	
  </head>
 <body onLoad="createSearch()">
   <div id="layout1">
      <div position="top">
   	 	<div class="panelBar">
           <ul class="toolBar">
		   		<li><a class="export" onclick="exportAP()"><span>导出Excel</span></a></li>
           </ul>
     	</div> 
     	<div id="pageHeader" class="pageHeader">
	        <div class="searchBar" id="multipleSearchDialog">
		        <table class="table" width="100%" id="searchHeader" >  
		            <tbody id="newbody">
		            </tbody>
		         </table>
	        	<div class="subBar">
		        	<ul>
			          <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
			          <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
		         	</ul>
	        	</div>
	        </div>
      	</div>
      </div>
      <div position="center" title="成品信息列表" id="table1">   
      </div>
      <div class="clear"></div>  
   </div> 
  </body>
</html>